import https from "./http";
import { React, useState, useEffect } from 'react';
import HomePage from '../parts/HomePage';
import registerServiceWorker from './registerServiceWorker';
import ReactDOM from 'react-dom';


// 配置对象
const [evaluate, setEvaluate] = useState([]);
// var num = [];
useEffect(() => {
    var notice, Notice, activity, Homeland, pay, Course, task, vacation, Photo, Appraisal, vote, remind;
    https('Notice_list/getAll', "get", res => {
        notice = res.data.length;
    });
    https('Notice_list/getAll', "get", res => {
        Notice = res.data.length;
    });
    https('Appraisal_list/getAll', "get", res => {
        activity = res.data.length;
    });
    https('Appraisal_list/getAll', "get", res => {
        Homeland = res.data.length;
    });
    https('Appraisal_list/getAll', "get", res => {
        pay = res.data.length;
    });
    https('Appraisal_list/getAll', "get", res => {
        Course = res.data.length;
    });
    https('Appraisal_list/getAll', "get", res => {
        task = res.data.length;
    });
    https('Health/getAll', "get", res => {
        Appraisal = res.data.length;
    });
    https('Student_vacation/getAll', "get", res => {
        vacation = res.data.length
    });
    https('Photo/getAll', "get", res => {
        Photo = res.data.length
    });
    https('Vote/getAll', "get", res => {
        vote = res.data.length;
    });
    https('Appraisal_list/getAll', "get", res => {
        remind = res.data.length;
        setEvaluate([notice, Notice, 15, 20, 44, 27, 66, vacation, Photo, Appraisal, vote, remind]);
    });
}, []);
useEffect(() => { },
    [evaluate]
);
console.log(evaluate)
ReactDOM.render(
    <HomePage data={evaluate}>

    </HomePage>,
    document.getElementById('root')
)
registerServiceWorker();
